SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO





CREATE PROCEDURE [dbo].[usp_UpdateEmployee]
      (
        @JOL_Employee_Account VARCHAR(50) ,--账号
        @JOL_Employee_Password VARCHAR(50) ,--密码
        @JOL_Employee_Name VARCHAR(50) ,--姓名
        @JOL_Employee_Sex BIT ,--性别
        @JOL_Employee_School VARCHAR(50) ,--学校
        @JOL_Employee_Profession VARCHAR(50) ,--专业
        @JOL_Employee_Longevity VARCHAR(50) ,--学历
        @JOL_Employee_StudyMethod VARCHAR(50) ,--学制
        @JOL_Employee_TrainMethod VARCHAR(50) ,--培养方式
        @JOL_Employee_StudyYearIn VARCHAR(50) ,--入学年份
        @JOL_Employee_StudyYearOut VARCHAR(50) ,--毕业年份
        @JOL_Employee_IDCardNo VARCHAR(50) ,--身份证号
        @JOL_Employee_Nation VARCHAR(50) ,--民族
        @JOL_Employee_Politics VARCHAR(50) ,--政治面貌
        @JOL_Employee_Province VARCHAR(50) ,--省份
        @JOL_Employee_Place VARCHAR(50) ,--生源地
        @JOL_Employee_TrainUnit VARCHAR(50) ,--委培单位
        @JOL_Employee_Mobile VARCHAR(50) ,--手机
        @JOL_Employee_Email VARCHAR(50) ,--邮箱
        @JOL_Employee_CredentialsFileLink VARCHAR(255) ,--证件路径
        @JOL_Employee_UpdateUser VARCHAR(50) ,--更新账户
        @JOL_Employee_VerifyStatus VARCHAR(50) ,
        @JOL_Employee_VerifyUser VARCHAR(50)
      )
AS 
      DECLARE @Pwd VARCHAR(50)
      SET @Pwd = (
                   SELECT   JOL_Employee_Password
                   FROM     dbo.JOL_Employee
                   WHERE    JOL_Employee_Account = @JOL_Employee_Account
                 )
      UPDATE    dbo.JOL_Employee
      SET       JOL_Employee_Name = @JOL_Employee_Name ,
                JOL_Employee_Password = CASE @JOL_Employee_Password
                                          WHEN '' THEN @Pwd
                                          ELSE @JOL_Employee_Password
                                        END ,
                JOL_Employee_Sex = @JOL_Employee_Sex ,
                JOL_Employee_School = @JOL_Employee_School ,
                JOL_Employee_Profession = @JOL_Employee_Profession ,
                JOL_Employee_Longevity = @JOL_Employee_Longevity ,
                JOL_Employee_StudyMethod = @JOL_Employee_StudyMethod ,
                JOL_Employee_TrainMethod = @JOL_Employee_TrainMethod ,
                JOL_Employee_StudyYearIn = @JOL_Employee_StudyYearIn ,
                JOL_Employee_StudyYearOut = @JOL_Employee_StudyYearOut ,
                JOL_Employee_IDCardNo = @JOL_Employee_IDCardNo ,
                JOL_Employee_Nation = @JOL_Employee_Nation ,
                JOL_Employee_Politics = @JOL_Employee_Politics ,
                JOL_Employee_Province = @JOL_Employee_Province ,
                JOL_Employee_Place = @JOL_Employee_Place ,
                JOL_Employee_TrainUnit = @JOL_Employee_TrainUnit ,
                JOL_Employee_Mobile = @JOL_Employee_Mobile ,
                JOL_Employee_Email = @JOL_Employee_Email ,
                JOL_Employee_CredentialsFileLink = @JOL_Employee_CredentialsFileLink ,
                JOL_Employee_UpdateUser = @JOL_Employee_UpdateUser ,
                JOL_Employee_UpdateTime = GETDATE() ,
                JOL_Employee_VerifyStatus = @JOL_Employee_VerifyStatus ,
                JOL_Employee_VerifyUser = @JOL_Employee_VerifyUser ,
                JOL_Employee_VerifyTime = CASE @JOL_Employee_VerifyStatus
                                            WHEN '已审核' THEN GETDATE()
                                            ELSE NULL
                                          END
      WHERE     JOL_Employee_Account = @JOL_Employee_Account





GO
